/*
package workexp.reflection;

import sun.reflect.ReflectionFactory;

*/
/*//*

        -XX:MetaspaceSize=64M -XX:MaxMetaspaceSize=64M -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC
        -XX:CMSInitiatingOccupancyFraction=75  -XX:+UseCMSInitiatingOccupancyOnly -XX:+PrintGCTimeStamps
        -XX:+PrintGCDetails -Dsun.reflect.inflationThreshold=0
        /*//*

public class TestMeta {

    public static void main(String[] args) throwsIOException, InvocationTargetException, IllegalAccessException {
        ReflectionFactory reflectorFactory = new DefaultReflectorFactory();
        System.out.println("load class start");
        // model有1000个方法
        Reflector reflector1 = reflectorFactory.findForClass(TestModel.class);
        Reflector reflector2 = reflectorFactory.findForClass(TestModel2.class);
        Reflector reflector3 = reflectorFactory.findForClass(TestModel3.class);

        System.out.println("load class finished");

        // model有1000个方法
        TestModel testModel = newTestModel();

        Object[] empty = {};
        Object[] one1 = {"a"};

        TestModel2 testModel2 = newTestModel2();

        TestModel3 testModel3 = newTestModel3();

        System.out.println("method invoke start");
        for (inti = 0; i < 1; i++) {
            for (intj = 0; j < 1000; j++) {
                reflector1.getSetInvoker("field" + j).invoke(testModel, one1);
                reflector1.getGetInvoker("field" + j).invoke(testModel, empty);

                reflector2.getSetInvoker("field" + j).invoke(testModel2, one1);
                reflector2.getGetInvoker("field" + j).invoke(testModel2, empty);

                reflector3.getSetInvoker("field" + j).invoke(testModel3, one1);
                reflector3.getGetInvoker("field" + j).invoke(testModel3, empty);
            }
        }
        System.out.println("method invoke finished");
        System.in.read();
    }

}
*/
